<template>
  <div class="login">
    <div class="login-container">
      <h1 class="login-container-title">Welcome</h1>
      <el-form>
        <el-form-item label="username">
          <el-input v-model="loginForm.username" />
        </el-form-item>
        <el-form-item label="password">
          <el-input v-model="loginForm.password" />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="handleLogin">Login</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';

const loginForm = ref({
  username: '',
  password: ''
});

const router = useRouter();
const handleLogin = () => {
  router.push('/blog');
};
</script>
<style lang="scss" scoped>
// style
.login {
  overflow: hidden;
  height: 100vh;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  color: #fff;

  &-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 300px;
    padding: 0 64px;
    border-radius: 10px;
    background: #fff;
    color: #000;

    &-title {
      margin: 32px 0;
      font-size: 32px;
      font-weight: 600;
      text-align: center;
    }
  }
}
</style>
